import config from '../config/config';
import request from '../utils/request';

let service = {};

// 买家地理位置
service.querylocation = (param, cb) => {
  param = param || {};

  let requestUrl = config.api.querylocation;
  request({
    url: requestUrl,
    showLoading: true,
    data: param,
    method: 'POST',
    success: res => {
      cb(res);
    }
  });
}

//所在城市的店铺
service.citystore = (param, cb) => {
  param = param || {};

  let requestUrl = config.api.citystore;
  request({
    url: requestUrl,
    showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    }
  });
}

//买家店铺浏览记录
service.historystore = (param, cb) => {
  param = param || {};

  let requestUrl = config.api.historystore;
  request({
    url: requestUrl,
    showLoading: true,
    data: param,
    method: 'POST',
    success: res => {
      cb(res);
    }
  });
}

//获取明星店铺
service.starstore = (param, cb) => {
  param = param || {};

  let requestUrl = config.api.starstore;
  request({
    url: requestUrl,
    showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    }
  });
}

module.exports = service;